home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / info-service / gopher / Unix / gopher1.12 / misc / newitems.pl next >
Mailbox/MIME Entity  |  1992-10-19  |  4.4 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Printerleaf/WorldView document (document/printerleafWorldViewDocument) ext Unsupported
1% dexvert Claris Works palette files (other/clarisWorksPaletteFiles) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file Mailbox text, 1st line "From comp.infosystems.gopher Mon Oct 19 11:52:09 1992", ASCII text default
100% TrID E-Mail message (Var. 2) default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% detectItEasy Format: Plain text[LF] default
100% xdgMime application/mbox default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 20 63 6f 6d | 70 2e 69 6e 66 6f 73 79 |From com|p.infosy|
|00000010| 73 74 65 6d 73 2e 67 6f | 70 68 65 72 20 4d 6f 6e |stems.go|pher Mon|
|00000020| 20 4f 63 74 20 31 39 20 | 31 31 3a 35 32 3a 30 39 | Oct 19 |11:52:09|
|00000030| 20 31 39 39 32 0a 50 61 | 74 68 3a 20 6e 65 77 73 | 1992.Pa|th: news|
|00000040| 2e 63 69 73 2e 75 6d 6e | 2e 65 64 75 21 75 6d 6e |.cis.umn|.edu!umn|
|00000050| 2e 65 64 75 21 75 6d 65 | 65 63 73 21 63 61 65 6e |.edu!ume|ecs!caen|
|00000060| 21 7a 61 70 68 6f 64 2e | 6d 70 73 2e 6f 68 69 6f |!zaphod.|mps.ohio|
|00000070| 2d 73 74 61 74 65 2e 65 | 64 75 21 64 61 72 77 69 |-state.e|du!darwi|
|00000080| 6e 2e 73 75 72 61 2e 6e | 65 74 21 6a 76 6e 63 2e |n.sura.n|et!jvnc.|
|00000090| 6e 65 74 21 6e 65 74 6e | 65 77 73 2e 75 70 65 6e |net!netn|ews.upen|
|000000a0| 6e 2e 65 64 75 21 6d 73 | 75 69 6e 66 6f 21 6e 65 |n.edu!ms|uinfo!ne|
|000000b0| 77 73 0a 46 72 6f 6d 3a | 20 62 6f 6f 6e 65 40 63 |ws.From:| boone@c|
|000000c0| 6f 6e 76 65 78 2e 63 6c | 2e 6d 73 75 2e 65 64 75 |onvex.cl|.msu.edu|
|000000d0| 20 28 44 65 6e 6e 69 73 | 20 42 6f 6f 6e 65 29 0a | (Dennis| Boone).|
|000000e0| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|000000f0| 2e 69 6e 66 6f 73 79 73 | 74 65 6d 73 2e 67 6f 70 |.infosys|tems.gop|
|00000100| 68 65 72 0a 53 75 62 6a | 65 63 74 3a 20 6e 65 77 |her.Subj|ect: new|
|00000110| 69 74 65 6d 73 20 73 63 | 72 69 70 74 0a 4b 65 79 |items sc|ript.Key|
|00000120| 77 6f 72 64 73 3a 20 6e | 65 77 20 69 74 65 6d 73 |words: n|ew items|
|00000130| 20 64 69 72 65 63 74 6f | 72 79 20 67 6f 70 68 65 | directo|ry gophe|
|00000140| 72 20 6c 69 6e 6b 73 0a | 4d 65 73 73 61 67 65 2d |r links.|Message-|
|00000150| 49 44 3a 20 3c 31 39 39 | 32 4f 63 74 31 33 2e 31 |ID: <199|2Oct13.1|
|00000160| 39 33 35 30 32 2e 39 33 | 33 34 40 6d 73 75 69 6e |93502.93|34@msuin|
|00000170| 66 6f 2e 63 6c 2e 6d 73 | 75 2e 65 64 75 3e 0a 44 |fo.cl.ms|u.edu>.D|
|00000180| 61 74 65 3a 20 31 33 20 | 4f 63 74 20 39 32 20 31 |ate: 13 |Oct 92 1|
|00000190| 39 3a 33 35 3a 30 32 20 | 47 4d 54 0a 53 65 6e 64 |9:35:02 |GMT.Send|
|000001a0| 65 72 3a 20 6e 65 77 73 | 40 6d 73 75 69 6e 66 6f |er: news|@msuinfo|
|000001b0| 2e 63 6c 2e 6d 73 75 2e | 65 64 75 0a 4f 72 67 61 |.cl.msu.|edu.Orga|
|000001c0| 6e 69 7a 61 74 69 6f 6e | 3a 20 4d 69 63 68 69 67 |nization|: Michig|
|000001d0| 61 6e 20 53 74 61 74 65 | 20 55 6e 69 76 65 72 73 |an State| Univers|
|000001e0| 69 74 79 2c 20 45 61 73 | 74 20 4c 61 6e 73 69 6e |ity, Eas|t Lansin|
|000001f0| 67 0a 4c 69 6e 65 73 3a | 20 31 37 37 0a 0a 57 65 |g.Lines:| 177..We|
|00000200| 20 77 61 6e 74 65 64 20 | 74 6f 20 62 65 20 61 62 | wanted |to be ab|
|00000210| 6c 65 20 74 6f 20 70 72 | 6f 76 69 64 65 20 61 20 |le to pr|ovide a |
|00000220| 6c 69 73 74 69 6e 67 20 | 6f 66 20 6e 65 77 2f 72 |listing |of new/r|
|00000230| 65 63 65 6e 74 6c 79 20 | 63 68 61 6e 67 65 64 20 |ecently |changed |
|00000240| 69 74 65 6d 73 0a 69 6e | 20 6f 75 72 20 47 6f 70 |items.in| our Gop|
|00000250| 68 65 72 20 73 65 72 76 | 65 72 2e 20 20 54 68 65 |her serv|er. The|
|00000260| 20 61 74 74 61 63 68 65 | 64 20 73 63 72 69 70 74 | attache|d script|
|00000270| 20 69 73 20 74 68 65 20 | 74 6f 6f 6c 20 49 20 64 | is the |tool I d|
|00000280| 65 76 65 6c 6f 70 65 64 | 20 74 6f 20 0a 70 72 6f |eveloped| to .pro|
|00000290| 76 69 64 65 20 74 68 69 | 73 2e 20 20 49 74 20 67 |vide thi|s. It g|
|000002a0| 65 6e 65 72 61 74 65 73 | 20 61 20 6c 69 6e 6b 20 |enerates| a link |
|000002b0| 66 69 6c 65 2c 20 73 6f | 20 74 68 65 20 6c 69 73 |file, so| the lis|
|000002c0| 74 69 6e 67 20 69 73 20 | 61 20 64 69 72 65 63 74 |ting is |a direct|
|000002d0| 6f 72 79 2c 0a 6e 6f 74 | 20 61 20 66 6c 61 74 20 |ory,.not| a flat |
|000002e0| 66 69 6c 65 2e 20 20 54 | 68 65 20 75 73 65 72 2d |file. T|he user-|
|000002f0| 76 69 73 69 62 6c 65 20 | 6e 61 6d 65 20 69 73 20 |visible |name is |
|00000300| 63 61 72 72 69 65 64 20 | 6f 76 65 72 2e 0a 0a 55 |carried |over...U|
|00000310| 73 61 67 65 3a 20 20 6e | 65 77 69 74 65 6d 73 20 |sage: n|ewitems |
|00000320| 2f 64 69 73 6b 2f 70 61 | 74 68 2f 6e 61 6d 65 20 |/disk/pa|th/name |
|00000330| 2d 23 64 61 79 73 6f 6c | 64 20 73 65 72 76 65 72 |-#daysol|d server|
|00000340| 2e 64 6f 6d 61 69 6e 2e | 6e 61 6d 65 20 23 70 6f |.domain.|name #po|
|00000350| 72 74 0a 0a 54 68 65 20 | 6c 69 6e 6b 20 66 69 6c |rt..The |link fil|
|00000360| 65 20 69 74 20 67 65 6e | 65 72 61 74 65 73 20 69 |e it gen|erates i|
|00000370| 73 20 63 61 6c 6c 65 64 | 20 2e 6e 65 77 6c 69 6e |s called| .newlin|
|00000380| 6b 73 20 69 6e 20 74 68 | 65 20 63 75 72 72 65 6e |ks in th|e curren|
|00000390| 74 20 64 69 72 65 63 74 | 6f 72 79 2e 0a 49 66 20 |t direct|ory..If |
|000003a0| 79 6f 75 20 70 6c 61 63 | 65 20 61 20 66 69 6c 65 |you plac|e a file|
|000003b0| 20 63 61 6c 6c 65 64 20 | 2e 6e 6f 6e 65 77 20 69 | called |.nonew i|
|000003c0| 6e 20 61 20 64 69 72 65 | 63 74 6f 72 79 2c 20 74 |n a dire|ctory, t|
|000003d0| 68 61 74 20 64 69 72 65 | 63 74 6f 72 79 20 69 73 |hat dire|ctory is|
|000003e0| 20 73 6b 69 70 70 65 64 | 2e 0a 49 66 20 79 6f 75 | skipped|..If you|
|000003f0| 20 70 6c 61 63 65 20 61 | 20 66 69 6c 65 20 63 61 | place a| file ca|
|00000400| 6c 6c 65 64 20 2e 74 6f | 70 6e 65 77 20 69 6e 20 |lled .to|pnew in |
|00000410| 61 20 64 69 72 65 63 74 | 6f 72 79 2c 20 74 68 61 |a direct|ory, tha|
|00000420| 74 20 64 69 72 65 63 74 | 6f 72 79 20 77 69 6c 6c |t direct|ory will|
|00000430| 20 62 65 0a 6c 69 73 74 | 65 64 20 69 66 20 61 6e | be.list|ed if an|
|00000440| 79 20 6e 65 77 20 66 69 | 6c 65 73 20 61 72 65 20 |y new fi|les are |
|00000450| 66 6f 75 6e 64 20 69 6e | 20 74 68 61 74 20 64 69 |found in| that di|
|00000460| 72 65 63 74 6f 72 79 20 | 6f 72 20 69 74 73 20 73 |rectory |or its s|
|00000470| 75 62 64 69 72 65 63 74 | 6f 72 69 65 73 2e 0a 54 |ubdirect|ories..T|
|00000480| 68 69 73 20 73 63 72 69 | 70 74 20 64 65 70 65 6e |his scri|pt depen|
|00000490| 64 73 20 6f 6e 20 74 68 | 65 20 67 6f 70 68 65 72 |ds on th|e gopher|
|000004a0| 6c 73 20 74 6f 6f 6c 20 | 77 68 69 63 68 20 69 73 |ls tool |which is|
|000004b0| 20 61 20 6c 69 6e 6b 20 | 74 6f 20 74 68 65 20 67 | a link |to the g|
|000004c0| 6f 70 68 65 72 64 20 0a | 70 72 6f 67 72 61 6d 2c |opherd .|program,|
|000004d0| 20 73 74 61 72 74 69 6e | 67 20 77 69 74 68 20 76 | startin|g with v|
|000004e0| 65 72 73 69 6f 6e 20 28 | 61 70 70 72 6f 78 29 20 |ersion (|approx) |
|000004f0| 31 2e 30 2e 20 20 59 6f | 75 27 6c 6c 20 6f 62 76 |1.0. Yo|u'll obv|
|00000500| 69 6f 75 73 6c 79 20 62 | 65 20 6e 65 65 64 69 6e |iously b|e needin|
|00000510| 67 0a 50 65 72 6c 2e 0a | 0a 54 68 69 73 20 73 63 |g.Perl..|.This sc|
|00000520| 72 69 70 74 20 73 65 65 | 6d 73 20 74 6f 20 62 65 |ript see|ms to be|
|00000530| 20 77 6f 72 6b 69 6e 67 | 20 66 6f 72 20 6d 65 2c | working| for me,|
|00000540| 20 62 75 74 20 68 61 73 | 6e 27 74 20 62 65 65 6e | but has|n't been|
|00000550| 20 74 65 73 74 65 64 20 | 65 78 68 61 75 73 74 69 | tested |exhausti|
|00000560| 76 65 6c 79 2e 0a 0a 44 | 65 6e 6e 69 73 0a 2d 2d |vely...D|ennis.--|
|00000570| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000580| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000590| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000005a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000005b0| 2d 2d 2d 2d 0a 23 21 2f | 75 73 72 2f 6c 6f 63 61 |----.#!/|usr/loca|
|000005c0| 6c 2f 62 69 6e 2f 70 65 | 72 6c 0a 23 20 6e 65 77 |l/bin/pe|rl.# new|
|000005d0| 69 74 65 6d 73 2c 20 62 | 6f 6f 6e 65 2c 20 30 39 |items, b|oone, 09|
|000005e0| 2f 33 30 2f 39 32 0a 23 | 20 47 65 6e 65 72 61 74 |/30/92.#| Generat|
|000005f0| 65 20 61 20 6c 69 6e 6b | 20 66 69 6c 65 20 6c 69 |e a link| file li|
|00000600| 73 74 69 6e 67 20 6e 65 | 77 20 69 74 65 6d 73 20 |sting ne|w items |
|00000610| 69 6e 20 74 68 65 20 6c | 61 73 74 20 6e 20 64 61 |in the l|ast n da|
|00000620| 79 73 0a 23 20 43 6f 70 | 79 72 69 67 68 74 20 28 |ys.# Cop|yright (|
|00000630| 43 29 20 31 39 39 32 2c | 20 54 72 75 73 74 65 65 |C) 1992,| Trustee|
|00000640| 73 20 6f 66 20 4d 69 63 | 68 69 67 61 6e 20 53 74 |s of Mic|higan St|
|00000650| 61 74 65 20 55 6e 69 76 | 65 72 73 69 74 79 0a 23 |ate Univ|ersity.#|
|00000660| 0a 23 20 4d 6f 64 69 66 | 69 63 61 74 69 6f 6e 73 |.# Modif|ications|
|00000670| 3a 0a 23 20 30 39 2f 33 | 30 2f 39 32 20 42 6f 6f |:.# 09/3|0/92 Boo|
|00000680| 6e 65 20 20 20 20 20 20 | 49 6e 69 74 69 61 6c 20 |ne |Initial |
|00000690| 63 6f 64 69 6e 67 0a 23 | 20 31 30 2f 30 31 2f 39 |coding.#| 10/01/9|
|000006a0| 32 20 42 6f 6f 6e 65 20 | 20 20 20 20 20 41 64 64 |2 Boone | Add|
|000006b0| 65 64 20 61 62 69 6c 69 | 74 79 20 74 6f 20 65 78 |ed abili|ty to ex|
|000006c0| 63 6c 75 64 65 20 69 6e | 64 69 76 69 64 75 61 6c |clude in|dividual|
|000006d0| 20 64 69 72 65 63 74 6f | 72 69 65 73 0a 23 20 45 | directo|ries.# E|
|000006e0| 6e 64 20 4d 6f 64 69 66 | 69 63 61 74 69 6f 6e 73 |nd Modif|ications|
|000006f0| 0a 0a 23 20 45 78 74 72 | 61 63 74 20 70 61 74 68 |..# Extr|act path|
|00000700| 20 70 61 72 74 20 6f 66 | 20 70 61 74 68 6e 61 6d | part of| pathnam|
|00000710| 65 0a 0a 73 75 62 20 70 | 61 74 68 0a 7b 0a 09 6c |e..sub p|ath.{..l|
|00000720| 6f 63 61 6c 28 24 70 61 | 74 68 29 20 3d 20 40 5f |ocal($pa|th) = @_|
|00000730| 3b 0a 09 6c 6f 63 61 6c | 28 24 70 61 74 68 73 65 |;..local|($pathse|
|00000740| 70 29 20 3d 20 72 69 6e | 64 65 78 28 24 70 61 74 |p) = rin|dex($pat|
|00000750| 68 2c 20 22 2f 22 29 3b | 0a 09 69 66 20 28 24 70 |h, "/");|..if ($p|
|00000760| 61 74 68 73 65 70 20 3c | 20 30 29 0a 09 7b 0a 09 |athsep <| 0)..{..|
|00000770| 09 72 65 74 75 72 6e 20 | 22 22 3b 0a 09 7d 0a 09 |.return |"";..}..|
|00000780| 65 6c 73 65 0a 09 7b 0a | 09 09 24 77 61 6e 74 65 |else..{.|..$wante|
|00000790| 64 20 3d 20 73 75 62 73 | 74 72 28 24 70 61 74 68 |d = subs|tr($path|
|000007a0| 2c 20 30 2c 20 24 70 61 | 74 68 73 65 70 2b 31 29 |, 0, $pa|thsep+1)|
|000007b0| 3b 0a 09 09 72 65 74 75 | 72 6e 20 24 77 61 6e 74 |;...retu|rn $want|
|000007c0| 65 64 3b 0a 09 7d 0a 7d | 0a 0a 23 20 45 78 74 72 |ed;..}.}|..# Extr|
|000007d0| 61 63 74 20 66 69 6c 65 | 6e 61 6d 65 20 70 61 72 |act file|name par|
|000007e0| 74 20 6f 66 20 70 61 74 | 68 6e 61 6d 65 0a 0a 73 |t of pat|hname..s|
|000007f0| 75 62 20 62 61 73 65 0a | 7b 0a 09 6c 6f 63 61 6c |ub base.|{..local|
|00000800| 28 24 70 61 74 68 29 20 | 3d 20 40 5f 3b 0a 09 6c |($path) |= @_;..l|
|00000810| 6f 63 61 6c 28 24 70 61 | 74 68 73 65 70 29 20 3d |ocal($pa|thsep) =|
|00000820| 20 72 69 6e 64 65 78 28 | 24 70 61 74 68 2c 20 22 | rindex(|$path, "|
|00000830| 2f 22 29 3b 0a 09 69 66 | 20 28 24 70 61 74 68 73 |/");..if| ($paths|
|00000840| 65 70 20 3c 20 30 29 0a | 09 7b 0a 09 09 72 65 74 |ep < 0).|.{...ret|
|00000850| 75 72 6e 20 24 70 61 74 | 68 3b 0a 09 7d 0a 09 65 |urn $pat|h;..}..e|
|00000860| 6c 73 65 0a 09 7b 0a 09 | 09 24 77 61 6e 74 65 64 |lse..{..|.$wanted|
|00000870| 20 3d 20 73 75 62 73 74 | 72 28 24 70 61 74 68 2c | = subst|r($path,|
|00000880| 20 24 70 61 74 68 73 65 | 70 2b 31 29 3b 0a 09 09 | $pathse|p+1);...|
|00000890| 72 65 74 75 72 6e 20 24 | 77 61 6e 74 65 64 3b 0a |return $|wanted;.|
|000008a0| 09 7d 0a 7d 0a 0a 23 20 | 44 65 74 65 72 6d 69 6e |.}.}..# |Determin|
|000008b0| 65 20 77 68 65 74 68 65 | 72 20 74 68 69 73 20 69 |e whethe|r this i|
|000008c0| 74 65 6d 20 69 73 20 70 | 61 72 74 20 6f 66 20 61 |tem is p|art of a|
|000008d0| 20 73 75 62 74 72 65 65 | 20 77 68 69 63 68 20 77 | subtree| which w|
|000008e0| 61 6e 74 73 20 74 6f 20 | 62 65 0a 23 20 61 6e 6e |ants to |be.# ann|
|000008f0| 6f 75 6e 63 65 64 20 61 | 73 20 61 20 73 69 6e 67 |ounced a|s a sing|
|00000900| 6c 65 20 6e 65 77 20 65 | 6e 74 72 79 20 69 66 20 |le new e|ntry if |
|00000910| 61 6e 79 20 66 69 6c 65 | 20 69 6e 20 69 74 20 68 |any file| in it h|
|00000920| 61 73 20 63 68 61 6e 67 | 65 64 2e 20 20 3c 70 61 |as chang|ed. <pa|
|00000930| 6e 74 3e 0a 23 20 45 78 | 61 6d 70 6c 65 3a 20 2f |nt>.# Ex|ample: /|
|00000940| 6e 65 77 73 2f 6e 65 77 | 73 70 61 70 65 72 73 2f |news/new|spapers/|
|00000950| 73 74 61 74 65 5f 6e 65 | 77 73 20 63 6f 6e 74 61 |state_ne|ws conta|
|00000960| 69 6e 73 20 61 20 66 69 | 6c 65 20 63 61 6c 6c 65 |ins a fi|le calle|
|00000970| 64 20 2e 74 6f 70 6e 65 | 77 2c 0a 23 20 69 6e 64 |d .topne|w,.# ind|
|00000980| 69 63 61 74 69 6e 67 20 | 74 68 61 74 20 61 6e 79 |icating |that any|
|00000990| 20 66 69 6c 65 20 69 6e | 20 74 68 65 20 73 74 61 | file in| the sta|
|000009a0| 74 65 20 6e 65 77 73 20 | 73 75 62 74 72 65 65 20 |te news |subtree |
|000009b0| 77 69 6c 6c 20 63 61 75 | 73 65 20 74 68 65 0a 23 |will cau|se the.#|
|000009c0| 20 2f 6e 65 77 73 2f 6e | 65 77 73 70 61 70 65 72 | /news/n|ewspaper|
|000009d0| 73 2f 73 74 61 74 65 5f | 6e 65 77 73 20 65 6e 74 |s/state_|news ent|
|000009e0| 72 79 20 74 6f 20 62 65 | 20 6c 69 73 74 65 64 20 |ry to be| listed |
|000009f0| 6f 6e 63 65 20 69 6e 20 | 74 68 65 20 6e 65 77 20 |once in |the new |
|00000a00| 69 74 65 6d 73 0a 23 20 | 6c 69 73 74 2e 0a 0a 73 |items.# |list...s|
|00000a10| 75 62 20 73 6b 69 70 0a | 7b 0a 09 6c 6f 63 61 6c |ub skip.|{..local|
|00000a20| 28 40 61 72 67 73 29 20 | 3d 20 40 5f 3b 0a 09 66 |(@args) |= @_;..f|
|00000a30| 6f 72 65 61 63 68 20 24 | 69 20 28 40 74 6f 70 6e |oreach $|i (@topn|
|00000a40| 65 77 29 0a 09 7b 0a 09 | 09 69 66 20 28 69 6e 64 |ew)..{..|.if (ind|
|00000a50| 65 78 28 24 61 72 67 73 | 5b 30 5d 2c 20 24 69 29 |ex($args|[0], $i)|
|00000a60| 20 3d 3d 20 30 29 0a 09 | 09 7b 0a 09 09 09 24 74 | == 0)..|.{....$t|
|00000a70| 6f 70 6c 69 73 74 7b 24 | 69 7d 20 3d 20 24 61 72 |oplist{$|i} = $ar|
|00000a80| 67 73 5b 30 5d 3b 0a 09 | 09 09 72 65 74 75 72 6e |gs[0];..|..return|
|00000a90| 20 31 3b 0a 09 09 7d 0a | 09 09 65 6c 73 65 0a 09 | 1;...}.|..else..|
|00000aa0| 09 7b 0a 09 09 7d 0a 09 | 7d 20 0a 09 72 65 74 75 |.{...}..|} ..retu|
|00000ab0| 72 6e 20 30 3b 0a 7d 0a | 0a 23 20 57 72 69 74 65 |rn 0;.}.|.# Write|
|00000ac0| 20 61 20 6c 69 6e 6b 20 | 66 69 6c 65 20 65 6e 74 | a link |file ent|
|00000ad0| 72 79 0a 0a 73 75 62 20 | 77 72 69 74 65 6c 69 6e |ry..sub |writelin|
|00000ae0| 6b 0a 7b 0a 09 6c 6f 63 | 61 6c 28 24 6c 69 6e 65 |k.{..loc|al($line|
|00000af0| 2c 20 24 70 61 74 68 29 | 20 3d 20 40 5f 3b 0a 09 |, $path)| = @_;..|
|00000b00| 6c 6f 63 61 6c 28 40 66 | 69 65 6c 64 73 29 20 3d |local(@f|ields) =|
|00000b10| 20 73 70 6c 69 74 28 2f | 5c 74 2f 2c 20 24 6c 69 | split(/|\t/, $li|
|00000b20| 6e 65 29 3b 0a 09 6c 6f | 63 61 6c 28 24 6e 61 6d |ne);..lo|cal($nam|
|00000b30| 65 29 20 3d 20 73 75 62 | 73 74 72 28 24 66 69 65 |e) = sub|str($fie|
|00000b40| 6c 64 73 5b 30 5d 2c 20 | 31 29 3b 0a 09 6c 6f 63 |lds[0], |1);..loc|
|00000b50| 61 6c 28 24 74 79 70 65 | 29 20 3d 20 73 75 62 73 |al($type|) = subs|
|00000b60| 74 72 28 24 66 69 65 6c | 64 73 5b 30 5d 2c 20 30 |tr($fiel|ds[0], 0|
|00000b70| 2c 20 31 29 3b 0a 09 70 | 72 69 6e 74 20 4c 46 20 |, 1);..p|rint LF |
|00000b80| 22 4e 61 6d 65 3d 24 6e | 61 6d 65 5c 6e 54 79 70 |"Name=$n|ame\nTyp|
|00000b90| 65 3d 24 74 79 70 65 5c | 6e 50 61 74 68 3d 24 70 |e=$type\|nPath=$p|
|00000ba0| 61 74 68 5c 6e 48 6f 73 | 74 3d 24 68 6f 73 74 5c |ath\nHos|t=$host\|
|00000bb0| 6e 50 6f 72 74 3d 24 70 | 6f 72 74 5c 6e 5c 6e 22 |nPort=$p|ort\n\n"|
|00000bc0| 3b 0a 7d 0a 0a 23 20 54 | 68 65 20 72 65 61 6c 20 |;.}..# T|he real |
|00000bd0| 63 6f 64 65 0a 0a 24 5b | 20 3d 20 30 3b 0a 69 66 |code..$[| = 0;.if|
|00000be0| 20 28 24 23 41 52 47 56 | 20 3c 20 33 29 0a 7b 0a | ($#ARGV| < 3).{.|
|00000bf0| 09 70 72 69 6e 74 20 53 | 54 44 45 52 52 20 22 55 |.print S|TDERR "U|
|00000c00| 73 61 67 65 3a 20 6e 65 | 77 69 74 65 6d 73 20 20 |sage: ne|witems |
|00000c10| 70 61 74 68 20 64 61 79 | 73 20 68 6f 73 74 20 70 |path day|s host p|
|00000c20| 6f 72 74 5c 6e 22 3b 0a | 09 65 78 69 74 28 31 29 |ort\n";.|.exit(1)|
|00000c30| 3b 0a 7d 0a 0a 6f 70 65 | 6e 28 4c 46 2c 20 22 3e |;.}..ope|n(LF, ">|
|00000c40| 2e 6e 65 77 6c 69 6e 6b | 73 22 29 20 7c 7c 20 64 |.newlink|s") || d|
|00000c50| 69 65 20 22 55 6e 61 62 | 6c 65 20 74 6f 20 63 72 |ie "Unab|le to cr|
|00000c60| 65 61 74 65 20 2e 6e 65 | 77 6c 69 6e 6b 73 5c 6e |eate .ne|wlinks\n|
|00000c70| 22 3b 0a 63 68 64 69 72 | 28 24 41 52 47 56 5b 30 |";.chdir|($ARGV[0|
|00000c80| 5d 29 3b 0a 63 68 6f 70 | 28 24 68 65 72 65 20 3d |]);.chop|($here =|
|00000c90| 20 60 70 77 64 60 29 3b | 0a 24 64 61 79 73 20 3d | `pwd`);|.$days =|
|00000ca0| 20 24 41 52 47 56 5b 31 | 5d 3b 0a 24 68 6f 73 74 | $ARGV[1|];.$host|
|00000cb0| 20 3d 20 24 41 52 47 56 | 5b 32 5d 3b 0a 24 70 6f | = $ARGV|[2];.$po|
|00000cc0| 72 74 20 3d 20 24 41 52 | 47 56 5b 33 5d 3b 0a 0a |rt = $AR|GV[3];..|
|00000cd0| 40 74 6f 70 6e 65 77 20 | 3d 20 60 66 69 6e 64 20 |@topnew |= `find |
|00000ce0| 2e 20 2d 6e 61 6d 65 20 | 2e 74 6f 70 6e 65 77 20 |. -name |.topnew |
|00000cf0| 2d 70 72 69 6e 74 60 3b | 0a 66 6f 72 65 61 63 68 |-print`;|.foreach|
|00000d00| 20 24 69 20 28 40 74 6f | 70 6e 65 77 29 0a 7b 0a | $i (@to|pnew).{.|
|00000d10| 09 24 69 20 3d 20 26 70 | 61 74 68 28 24 69 29 3b |.$i = &p|ath($i);|
|00000d20| 0a 7d 0a 6f 70 65 6e 28 | 4e 46 2c 20 22 66 69 6e |.}.open(|NF, "fin|
|00000d30| 64 20 2e 20 2d 6d 74 69 | 6d 65 20 24 64 61 79 73 |d . -mti|me $days|
|00000d40| 20 2d 74 79 70 65 20 66 | 20 2d 70 72 69 6e 74 20 | -type f| -print |
|00000d50| 7c 20 67 72 65 70 20 2d | 76 20 2e 63 61 70 20 7c || grep -|v .cap ||
|00000d60| 22 29 20 7c 7c 20 0a 09 | 64 69 65 20 22 55 6e 61 |") || ..|die "Una|
|00000d70| 62 6c 65 20 74 6f 20 73 | 70 61 77 6e 20 66 69 6e |ble to s|pawn fin|
|00000d80| 64 5c 6e 22 3b 0a 77 68 | 69 6c 65 20 28 3c 4e 46 |d\n";.wh|ile (<NF|
|00000d90| 3e 29 0a 7b 0a 09 6e 65 | 78 74 20 69 66 20 2f 5c |>).{..ne|xt if /\|
|00000da0| 2e 63 61 70 2f 3b 0a 09 | 6e 65 78 74 20 69 66 20 |.cap/;..|next if |
|00000db0| 2f 5c 2e 74 73 2f 3b 0a | 09 6e 65 78 74 20 69 66 |/\.ts/;.|.next if|
|00000dc0| 20 2f 5c 2e 62 69 6e 2f | 3b 0a 09 63 68 6f 70 3b | /\.bin/|;..chop;|
|00000dd0| 0a 09 24 70 61 74 68 20 | 3d 20 26 70 61 74 68 28 |..$path |= &path(|
|00000de0| 24 5f 29 3b 0a 09 24 62 | 61 73 65 20 3d 20 26 62 |$_);..$b|ase = &b|
|00000df0| 61 73 65 28 24 5f 29 3b | 0a 09 6e 65 78 74 20 69 |ase($_);|..next i|
|00000e00| 66 20 28 24 62 61 73 65 | 20 3d 7e 20 2f 5e 5c 2e |f ($base| =~ /^\.|
|00000e10| 2f 29 3b 0a 09 63 68 64 | 69 72 28 24 70 61 74 68 |/);..chd|ir($path|
|00000e20| 29 20 7c 7c 20 64 69 65 | 20 22 63 68 64 69 72 28 |) || die| "chdir(|
|00000e30| 24 70 61 74 68 29 20 64 | 69 65 64 3a 20 24 21 5c |$path) d|ied: $!\|
|00000e40| 6e 22 3b 0a 09 69 66 20 | 28 21 20 2d 66 20 22 2e |n";..if |(! -f ".|
|00000e50| 6e 6f 6e 65 77 22 29 0a | 09 7b 0a 09 09 40 6c 69 |nonew").|.{...@li|
|00000e60| 6e 65 73 20 3d 20 60 2f | 75 73 72 2f 6c 6f 63 61 |nes = `/|usr/loca|
|00000e70| 6c 2f 65 74 63 2f 67 6f | 70 68 65 72 6c 73 20 2e |l/etc/go|pherls .|
|00000e80| 60 3b 0a 09 09 66 6f 72 | 65 61 63 68 20 24 69 20 |`;...for|each $i |
|00000e90| 28 40 6c 69 6e 65 73 29 | 0a 09 09 7b 0a 09 09 09 |(@lines)|...{....|
|00000ea0| 63 68 6f 70 28 24 69 29 | 3b 20 63 68 6f 70 28 24 |chop($i)|; chop($|
|00000eb0| 69 29 3b 0a 09 09 09 40 | 66 69 65 6c 64 73 20 3d |i);....@|fields =|
|00000ec0| 20 73 70 6c 69 74 28 2f | 5c 74 2f 2c 20 24 69 29 | split(/|\t/, $i)|
|00000ed0| 3b 0a 09 09 09 24 74 68 | 69 73 6e 61 6d 65 20 3d |;....$th|isname =|
|00000ee0| 20 73 75 62 73 74 72 28 | 24 66 69 65 6c 64 73 5b | substr(|$fields[|
|00000ef0| 31 5d 2c 20 32 29 3b 0a | 09 09 09 69 66 20 28 24 |1], 2);.|...if ($|
|00000f00| 74 68 69 73 6e 61 6d 65 | 20 65 71 20 24 62 61 73 |thisname| eq $bas|
|00000f10| 65 29 0a 09 09 09 7b 0a | 09 09 09 09 69 66 20 28 |e)....{.|....if (|
|00000f20| 21 20 26 73 6b 69 70 28 | 24 5f 29 29 0a 09 09 09 |! &skip(|$_))....|
|00000f30| 09 7b 0a 09 09 09 09 09 | 26 77 72 69 74 65 6c 69 |.{......|&writeli|
|00000f40| 6e 6b 28 24 69 2c 20 24 | 5f 29 3b 0a 09 09 09 09 |nk($i, $|_);.....|
|00000f50| 7d 0a 09 09 09 7d 0a 09 | 09 09 75 6e 64 65 66 28 |}....}..|..undef(|
|00000f60| 40 66 69 65 6c 64 73 29 | 3b 0a 09 09 7d 0a 09 09 |@fields)|;...}...|
|00000f70| 75 6e 64 65 66 28 40 6c | 69 6e 65 73 29 3b 0a 09 |undef(@l|ines);..|
|00000f80| 7d 0a 09 63 68 64 69 72 | 28 24 68 65 72 65 29 20 |}..chdir|($here) |
|00000f90| 7c 7c 20 64 69 65 20 22 | 63 68 64 69 72 28 24 68 ||| die "|chdir($h|
|00000fa0| 65 72 65 29 20 64 69 65 | 64 3a 20 24 21 5c 6e 22 |ere) die|d: $!\n"|
|00000fb0| 3b 0a 7d 0a 66 6f 72 65 | 61 63 68 20 24 69 20 28 |;.}.fore|ach $i (|
|00000fc0| 6b 65 79 73 20 25 74 6f | 70 6c 69 73 74 29 0a 7b |keys %to|plist).{|
|00000fd0| 0a 09 63 68 6f 70 28 24 | 69 29 3b 0a 09 24 62 61 |..chop($|i);..$ba|
|00000fe0| 73 65 20 3d 20 26 62 61 | 73 65 28 24 69 29 3b 0a |se = &ba|se($i);.|
|00000ff0| 09 63 68 64 69 72 28 24 | 69 29 20 7c 7c 20 64 69 |.chdir($|i) || di|
|00001000| 65 20 22 63 68 64 69 72 | 28 24 70 61 74 68 29 20 |e "chdir|($path) |
|00001010| 64 69 65 64 3a 20 24 21 | 5c 6e 22 3b 0a 09 63 68 |died: $!|\n";..ch|
|00001020| 64 69 72 28 22 2e 2e 22 | 29 20 7c 7c 20 64 69 65 |dir(".."|) || die|
|00001030| 20 22 63 68 64 69 72 28 | 2e 2e 29 20 64 69 65 64 | "chdir(|..) died|
|00001040| 3a 20 24 21 5c 6e 22 3b | 0a 09 40 6c 69 6e 65 73 |: $!\n";|..@lines|
|00001050| 20 3d 20 60 2f 75 73 72 | 2f 6c 6f 63 61 6c 2f 65 | = `/usr|/local/e|
|00001060| 74 63 2f 67 6f 70 68 65 | 72 6c 73 20 2e 60 3b 0a |tc/gophe|rls .`;.|
|00001070| 09 66 6f 72 65 61 63 68 | 20 24 6a 20 28 40 6c 69 |.foreach| $j (@li|
|00001080| 6e 65 73 29 0a 09 7b 0a | 09 09 63 68 6f 70 28 24 |nes)..{.|..chop($|
|00001090| 6a 29 3b 20 63 68 6f 70 | 28 24 6a 29 3b 0a 09 09 |j); chop|($j);...|
|000010a0| 40 66 69 65 6c 64 73 20 | 3d 20 73 70 6c 69 74 28 |@fields |= split(|
|000010b0| 2f 5c 74 2f 2c 20 24 6a | 29 3b 0a 09 09 24 74 68 |/\t/, $j|);...$th|
|000010c0| 69 73 6e 61 6d 65 20 3d | 20 73 75 62 73 74 72 28 |isname =| substr(|
|000010d0| 24 66 69 65 6c 64 73 5b | 31 5d 2c 20 32 29 3b 0a |$fields[|1], 2);.|
|000010e0| 09 09 69 66 20 28 24 74 | 68 69 73 6e 61 6d 65 20 |..if ($t|hisname |
|000010f0| 65 71 20 24 62 61 73 65 | 29 0a 09 09 7b 0a 09 09 |eq $base|)...{...|
|00001100| 09 26 77 72 69 74 65 6c | 69 6e 6b 28 24 6a 2c 20 |.&writel|ink($j, |
|00001110| 24 69 29 3b 0a 09 09 7d | 0a 09 09 75 6e 64 65 66 |$i);...}|...undef|
|00001120| 28 40 66 69 65 6c 64 73 | 29 3b 0a 09 7d 0a 09 75 |(@fields|);..}..u|
|00001130| 6e 64 65 66 28 40 6c 69 | 6e 65 73 29 3b 0a 09 63 |ndef(@li|nes);..c|
|00001140| 68 64 69 72 28 24 68 65 | 72 65 29 20 7c 7c 20 64 |hdir($he|re) || d|
|00001150| 69 65 20 22 63 68 64 69 | 72 28 24 68 65 72 65 29 |ie "chdi|r($here)|
|00001160| 20 64 69 65 64 3a 20 24 | 21 5c 6e 22 3b 0a 7d 0a | died: $|!\n";.}.|
|00001170| 63 6c 6f 73 65 28 4e 46 | 29 3b 0a 63 6c 6f 73 65 |close(NF|);.close|
|00001180| 28 4c 46 29 3b 0a 2d 2d | 0a 20 3d 3d 20 49 66 20 |(LF);.--|. == If |
|00001190| 79 6f 75 20 63 68 6f 6f | 73 65 20 6e 6f 74 20 74 |you choo|se not t|
|000011a0| 6f 20 64 65 63 69 64 65 | 2c 20 79 6f 75 20 73 74 |o decide|, you st|
|000011b0| 69 6c 6c 20 68 61 76 65 | 20 6d 61 64 65 20 61 20 |ill have| made a |
|000011c0| 63 68 6f 69 63 65 2e 20 | 3d 3d 0a 0a |choice. |==.. |
+--------+-------------------------+-------------------------+--------+--------+